#ifndef Signal_H
#define Signal_H
#include "Global_Signal.h"
#include "signals.h"

class SIGNALSHARED_EXPORT Signal : public AbstractSignal
{
    public:

    AbstractSignal * signal;

    template <class T>
    Signal(T * ref);                                                        /*! Signal0 */

    template <class T, class U>
    Signal(int (T::*aSignal)(U),T * ref, U arg);                            /*! Signal1 */

    template <class T, class U, class V>
    Signal(int (T::*aSignal)(U,V),T * ref, U arg, V aArg2);                 /*! Signal2 */

    template <class T, class U, class V, class W>
    Signal(int (T::*aSignal)(U,V,W),T * ref, U arg, V aArg2, W aArg3);      /*! Signal3 */

    template<class T>
    Signal(int (*aSignal)(T),T aArg1);                                      /*! sSignal1 */

    template<class T,class U>
    Signal(int (*aSignal)(T,U),T aArg1, U aArg2);                           /*! sSignal2 */

    template<class T,class U, class W>
    Signal(int (*aSignal)(T,U,W),T aArg1, U aArg2, W aArg3);                /*! sSignal3 */

    void Update();
    //void Connect(AbstractSlot *aSlot);

};

/*! Signal0 */

template <class T>
Signal::Signal(T * ref)
{
    Signal= new Signal0<T>(aSignal,ref);
}

/*! slot1 */

template <class T, class U>
Signal::Signal(int (T::*aSignal)(U),T * ref, U arg)
{
    Signal = new Signal1<T,U>(aSignal, ref, arg);
}

/*! slot2*/

template <class T, class U, class V>
Signal::Signal(int (T::*aSignal)(U,V),T * ref, U arg, V aArg2)
{
    Signal = new Signal2<T,U,V>(aSignal, ref,  arg,  aArg2);
}

/*! slot3 */

template <class T, class U, class V, class W>
Signal::Signal(int (T::*aSignal)(U,V,W),T * ref, U arg, V aArg2, W aArg3)
{
    Signal = new Signal3<T,U,V,W>(aSignal, ref,  arg,  aArg2, aArg3);
}

/*! sSlot1 */

template<class T>
Signal::Signal(int (*aSignal)(T),T aArg1)
{
   Signal=new sSignal1<T>(aSignal,aArg1);
}

/*! sSlot2 */

template<class T,class U>
Signal::Signal(int (*aSignal)(T,U),T aArg1, U aArg2)
{
     Signal=new sSignal2<T,U>(aSignal,aArg1,aArg2);
}

/*! sSlot3 */

template<class T,class U, class W>
Signal::Signal(int (*aSignal)(T,U,W),T aArg1, U aArg2, W aArg3)
{
    Signal=new sSignal3<T,U,W>(aSignal,aArg1,aArg2,aArg3);
}
#endif // Signal0_H
